<cfparam name="PARAMS.isPDF" default="false">
<cfparam name="PARAMS.debug" default="false">
<cfoutput>
	#dspDocumentHeader()#
	<h2>Consent to Exchange Information <span class="caption">COMAR 10.21.17.04 A(1-2)</span></h2>
	<cfif PARAMS.key NEQ 0>#dspFormButtons(key=PARAMS.key, action=PARAMS.controller)#</cfif>
	<cfsavecontent variable="document">
		<fieldset>
			<p class="strong" style="margin-bottom: 2em;">
				I understand that different agencies provide different services and benefits. Each agency must have specific information in order 
				to provide services and benefits. By signing this form, I am allowing Safe Journey House to exchange certain information with
				the listed agency(s)/person(s) so that they will be able to work effectively with me to provide and/or coordinate services and/
			 	or benefits. However, Safe Journey House may disclose, without consent, certain protected health information to other medical
				assistance programs and providers.
			</p>
			
			<table align="center" cellpadding="3">
				<tr><td class="formInput">#document.consumerName#</td><td colspan="2"></td></tr>
				<tr><td class="formLabel2">Full Printed Name of Client</td><td colspan="2"></td></tr>
				<cfloop from="1" to ="2" index="intRow">
					<tr>
					<cfloop list="Address,DateOfBirth,SSN" index="formLabel">					
						<cfif intRow EQ 1>
							<td valign="bottom">
								<cfif formLabel IS "Address">
									#dspAddress()#
								<cfelseif formLabel IS "SSN">
									#dspSSN()#
								<cfelse>
									#textFieldTag(id="#PARAMS.key#-#formLabel#", class="#IIF(formLabel IS 'DateOfBirth', DE('date'), DE(''))#", name="#PARAMS.key#[#formLabel#]", value="")#
								</cfif>
							</td>
						<cfelse>
							<td class="formLabel3">#humanize(formLabel, "SSN")#</td>
						</cfif>					
					</cfloop>
					</tr>
				</cfloop>
			</table>
		
			<hr />
			
			<p class="strong" style="margin-bottom: 2em;">I want the following confidential information about my care to be exchanged:</p>
			<cfset ConfidentialInfo = {
					"Assessment Information" = "assessmentInformation",
					"Financial Information" = "financialInformation",
					"Benefits/Services Needed, Planned, and/or Received" = "benefitsServices", 
					"Substance Use/Abuse History" = "substanceAbuseHistory",
					"Medical Diagnosis" = "medicalDiagnosis",
					"Mental Health Diagnosis" = "mentalHealthDiagnosis",
					"Medical Records" = "medicalRecords",
					"Psychological Records" = "psychologicalRecords", 
					"Education Records" = "educationRecords",
					"Psychiatric Records" = "psychiatricRecords",
					"Criminal Justice Records" = "criminalJusticeRecords",
					"Employment Records" = "employmentRecords"
				}>
				
			<table class="forms" cellpadding="10" align="center">
				<tr class="title">
					<td></td>
					<td>Yes</td>
					<td>No</td>
				</tr>
				<cfloop collection="#confidentialInfo#" item="InfoName">
					<tr>
						<td class="left">#InfoName#</td>
						<td nowrap="true">
							#dspRadioButton("#confidentialInfo[infoName]#", "#PARAMS.key#[#confidentialInfo[infoName]#]", "1")#
						</td>
						<td nowrap="true">
							#dspRadioButton("#confidentialInfo[infoName]#", "#PARAMS.key#[#confidentialInfo[infoName]#]", 	"0")#
						</td>
					</tr>
				</cfloop>
			</table>
			<hr />
			
			<p class="strong" style="margin-bottom: 2em;">I give consent for staff at Safe Journey House to exchange information with: <span class="caption">COMAR 10.21.17.04 A(1)(ii)</span></p>
			
			<table>
				<tr>
					<td>Name: <input type="text" /></td>
					<td style="padding-left: 10px;">Phone Number: #dspPhoneNumber()#</td>
					<td style="padding-left: 6px;" valign="middle">
						<button class="btn btn-info btn-single2 addButton" title="Add User">
							<i class="icon-plus icon-white"></i>
						</button>
					</td>
				</tr>
			</table>
			
			<hr />
			
			<dl>
				<dt>I give consent for the following information to be exchanged <strong>ONLY</strong> for the following purposes(s):</dt>
				<cfset InformationType = ["serviceCoordination","dischargePlanning","eligibilityDetermination","other"]>
				<cfloop array="#InformationType#" index="InfoName">
					<dt class="list">
						<span class="formInput">#checkboxTag(id="#PARAMS.key#-#InfoName#", name="#PARAMS.key#[#InfoName#]", value="1")#</span>
						<span class="formLabel">#humanize(infoName)#</span>
					</dt>
				</cfloop>
			</dl>
			
			<hr />
			
			<p>This consent is good until: #textFieldTag(id="#PARAMS.key#-consentExpiration", class="date", name="#PARAMS.key#[consentExpiration]", value=document.consentExpiration)#</p>
			
			<p class="strong" style="margin-bottom: 2em;">
				I can withdraw this consent at any time by notifying SJH in writing. This will stop the listed agency(s)/person(s) from
				sharing information after they know my consent has been withdrawn. I have the right to know what information about me
				has been or will be shared, and why, when, and with whom it was shared.<br /><br />
				
				I want the above agency(s)/person(s) to accept a copy of this form as valid consent to share information.
			</p>
			
			<table width="50%">
				<tr>
					<td>Consumer Signature: #document.consumerName#</td>
					<td>Date: #textFieldTag(id="#PARAMS.key#-consumerSignatureDate", class="date", name="#PARAMS.key#[consumerSignatureDate]", value=document.consumerSignatureDate2)#</td>
				</td>
				<tr>
					<td>Counselor Signature: #textFieldTag(id="#PARAMS.key#-counselorSignature", name="#PARAMS.key#[counselorSignature]", value=document.counselorSignature)#</td>
					<td>Date: #textFieldTag(id="#PARAMS.key#-", class="date", name="#PARAMS.key#[]", value="")#</td>
				</tr>
			</table>
		</fieldset>
	</cfsavecontent>
	<cfif PARAMS.key NEQ 0>#dspFormButtons(PARAMS.key)#</cfif>
	<cfif PARAMS.key EQ 0 AND PARAMS.isPDF AND NOT StructKeyExists(PARAMS, "debug")>
		<cfdocument format="pdf">
			#document#
		</cfdocument>
	<cfelse>
	#document#
	</cfif>
</cfoutput>